<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>component-3</title>
    <script type="text/javascript" src="../assets/js/vue-2.3.0.js"></script>
</head>

<body>
    <h1>组件-3父子组件</h1>
    <hr>
    <div id="app">
        <wukong></wukong>
    </div>
</body>
<script type="text/javascript">
    // 子组件写在父组件上方
    var armComponent = {
        template: '<div>手拿如意金箍棒</div>'
    }
    var carComponent = {
        template: '<div>脚踩五彩筋斗云</div>'
    }
    var jobComponent = {
        template: '<div>保护唐僧取西经</div>'
    }
    var monkeyComponent = {
        template: '<div><div>悟空来自花果山</div><arm></arm><car></car><job></job></div>',
        components: {
            "arm": armComponent,
            "car": carComponent,
            "job": jobComponent
        }
    }
    var app = new Vue({
        el: "#app",
        data: {

        },
        components: {
            "wukong": monkeyComponent
        }
    })
</script>

</html>